<template>
  <div id="wxInner">
    <div class="wx-loding">
      <van-loading size="60px" type="spinner"></van-loading>
      <p>加载中...</p>
    </div>
  </div>
</template>

<script>
import modelFunctions from "../../utils/modelFunction";
import * as types from "../../store/mutation-types";
import { Dialog } from "vant";
export default {
  data() {
    return {
      code: ""
    };
  },
  created() {
    this.initData();
  },
  methods: {
    async initData() {
      let param = modelFunctions.urlParam();
      let str = JSON.stringify(param.code);
      let res = await this.$bridge.jsCall("pullApp", { str }); // 跳转app，app拉起微信小程序--传参：code、wx_id（微信小程序原始ID）、wx_type（微信小程序版本：正式版0、开发板1、体验版2）
      if (res) {
        this.payBill(res);
      }
    },
    payBill(data) {
      let uri = "https://service.neuqsoft.com/ggfw/citizen/#/inner?back=";
      location.href = encodeURIComponent(uri) + JSON.stringify(data);
      // "http://10.19.92.209:8880/inner?back=" + JSON.stringify(data);
    }
  }
};
</script>

<style lang="less">
#wxInner {
  width: 100%;
  height: 100%;
  position: relative;

  .wx-loding {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
